<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
 const obj = {
        name:'xiaoming',
        male:'男',
        age:{
            a:18,
            b:20
        }
    }

    const obj1 = {...obj};//浅拷贝
    obj.name='xiaohong'
    obj.age.a = 20;
    obj.age.arr = {a:20}
    console.log(obj1)
    console.log(obj)


</script>